//
// Created by TheMorbidArk on 2022/11/6.
//

#include "ObjRange.h"
#include "utils.h"
#include "Class.h"
#include "vm.h"

ObjRange *ObjRange::NewObjRange(VM *vm, int from, int to) {
    auto* objRange = ALLOCATE(vm, ObjRange);
    objRange->objHeader = *new ObjHeader(vm,OT_RANGE, vm->rangeClass);
    objRange->from = from;
    objRange->to = to;
    return objRange;
}

ObjRange::ObjRange(VM *vm, int from, int to) {
    auto* objRange = ALLOCATE(vm, ObjRange);
    objRange->objHeader = *new ObjHeader(vm,OT_RANGE, vm->rangeClass);
    objRange->from = from;
    objRange->to = to;

    this->objHeader = objRange->objHeader;
    this->from = objRange->from;
    this->to = objRange->to;

}
